--- The 'Tensor' type class with '***' operation.
package frege.control.Tensor where

import frege.control.Semigroupoid (Semigroupoid())

infixr 3 `***`

class (Semigroupoid f) => Tensor f where
  {--
      Split the input between the two argument semigroupoids and combine
      their output.  Note that this is in general not a functor.
  -}
  (***) :: f a b -> f c d -> f (a, c) (b, d)

instance Tensor (->) where
  f *** g = \(a, c) -> (f a, g c)